<template>
	<view class="content">
		<view class="mores-txt flex">
		</view>
		<!-- 首发新品 -->
		<view class="index-product-wrapper" :class="iSshowH?'on':''">
			<view class="list-box animated" :class='tempArr.length > 0?"fadeIn on":""'>
				<view class="item" v-for="(item,index) in tempArr" :key="index">
					<view class="text-info">
						<view class="title line1">{{item.name}}</view>
						<view class="old-green"><text>进行中</text></view>
						<view class="price"><text>￥</text>{{item.price}}</view>
					</view>
					<view calss='btn-line'  @click="receiving_add(item)">
						<button class="btn1" >领取</button>
					</view>
				</view>
			</view>
			<view class='loadingicon acea-row row-center-wrapper' v-if="goodScroll">
				<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>
			</view>
		<!-- 	<view class="mores-txt flex" v-if="!goodScroll">
				<text>我是有底线的</text>
			</view> -->
		</view>
	</view>
</template>

<script>
	import {
		getIndexData,
		receivingAdd
	} from '@/api/api';
	export default {
		data() {
			return {
				explosiveMoney:[],
				tempArr:[],
				goodScroll:true,
				loading:true,
				iSshowH:true,
				tabsScrollLeft: 0, // tabs当前偏移量
				marTop:20,
			}
		},
		onLoad() {
			this.getIndexConfig();
		},
		methods: {
			// 首页数据
			getIndexConfig: function() {
				let that = this;
				getIndexData().then(res => {
					this.loading=false;
					this.goodScroll=false;
					this.tempArr=res.data.list;
				})
			},
			// 领取任务
			receiving_add:function(item){
				this.$util.Tips({
					title: '领取成功',
					icon: 'success'
				},()=>{
					console.log(item)
				})
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
	.index-product-wrapper{
		width: 100%;
		padding: 20rpx 0;
	}
	.list-box{
		
	
		display: flex;
		flex-direction:column;
		justify-content: flex-end;
		align-items:  flex-end;
		padding: 20rpx 0;
		border-bottom:#f5f5f5 2rpx solid ;
		width: 100%;
	}
	.item{
		width: 100%;
		display: flex;
		flex-direction:row;
		justify-content: center;
		align-items:center;
	}
	.text-info{
		width: 80%;
		display: flex;
		flex-direction:row;
		justify-content: space-evenly;
		align-items:center;
		font-size: 32rpx;
	}
	.btn1{
	  padding: 10rpx 20rpx;
	  font-size: 32rpx;
	  text-align: center;
	  cursor: pointer;
	  outline: none;
	  color: #fff;
	  background-color: #4CAF50;
	  border: none;
	  border-radius: 5rpx;
	  /* box-shadow: 0 9px #999; */
	}
	 
	.btn1:hover {background-color: #3e8e41}
	 
	.btn1:active {
	  background-color: #3e8e41;
	  /* box-shadow: 0 5px #666; */
	  transform: translateY(4px);
	}
	.old-green{
		color:#00f12b;
		font-size: 28rpx;
	}
	.price{
		font-size: 28rpx;
		color:red
	}
</style>
